package main


import (
	"fmt"
)
//go 切片  使用方法  1数组  2make 3 直接使用
func main(){

	//make(type,len,cap)
	var slice []float64=make([]float64,5,10)

	slice[0]=10
	slice[2]=300

	fmt.Printf("slice=%v,len=%d,cap=%d\n",slice,len(slice),cap(slice))

	//第3种方式 
	var city[]string = []string{"bj","sh","gd"}
	//city[10]="china"
	fmt.Printf("city=%v,type=%T,len=%d,cap=%d\n",city,city,len(city),cap(city))
	//数组
	var s[5]string = [...]string{"abc","test","s","d","e"}
	fmt.Printf("s=%v,type=%T\n",s,s)
}